<?php
class Human {
    public $name;
    public $height;
    public $weight;

    public function eat($food) {
        echo $this->name . "'s eating " . $food . "\n";
    }
}
class NbaPlayer extends Human {
    # define attribute
    public $team = "Bull";
    public $playernumber = "23";

    #define default 
    public function __construct($name, $height, $weight, $playernumber) {
        echo "In Nbaplayer constructor\n </br>";
        $this->name = $name;
        $this->height = $height;
        $this->weight = $weight;
        $this->playernumber = $playernumber;
    }

    public function __destruct() {
        echo "Destroying" . $this->name . "\n";
    }
    # define function
    public function run() {
        echo "Running\n";
    }

    public function jump() {
        echo "jumping\n";
    }

    public function dribble() {
        echo "dribbling\n";
    }

    public function shoot() {
        echo "shooting\n";
    }

    public function dunk() {
        echo "dunking\n";
    }

    public function pass() {
        echo "passing\n";
    }
}


/*$jordan = new NbaPlayer("william", "180", "82", "23");
echo $jordan->name . "\n";
echo "</br>";
echo $jordan->height . "\n";
echo "</br>";
echo $jordan->weight . "\n";
echo "</br>";
echo $jordan->playernumber . "\n";
echo "</br>";
$jordan->dribble();
echo "</br>";
$jordan->pass();
echo "</br>";

$BA = new NbaPlayer("ba", "175", "82", "23");
echo $BA->name . "\n";
echo "</br>";
echo $BA->height . "\n";
echo "</br>";
echo $BA->weight . "\n";
echo "</br>";
echo $BA->playernumber . "\n";
echo "</br>";
$BA->dribble();
echo "</br>";
$BA->pass();
echo "</br>";

#setup null valul
$BA1 = $BA;
$BA =null;
echo "</br>";
echo "From now on BA not in value";
echo "</br>"; */

$jordan = new NbaPlayer("william", "198cm", "98kg", "Bull", "23");

echo $jordan->name ."\n";

echo "</br>";

$jordan->eat("Apple");

echo "</br>";

?>
